package com.shh.aiojbackendserver.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;


/**
 * 题目提交接口
 *
 */
@RestController
//@RequestMapping("/question_submit/")
@Slf4j
@Deprecated
public class QuestionSubmitController {

//    @Resource
//    private QuestionSubmitService QuestionSubmitService;
//
//    @Resource
//    private UserService userService;
//
//    /**
//     * 处理提交题目
//     *
//     * @param questionSubmitAddRequest
//     * @param request
//     * @return
//     */
//    @PostMapping("/")
//    public BaseResponse<Long> doSubmitQuestion(@RequestBody QuestionSubmitAddRequest questionSubmitAddRequest,
//            HttpServletRequest request) {
//        if (questionSubmitAddRequest == null || questionSubmitAddRequest.getQuestionId() <= 0) {
//            throw new BusinessException(ErrorCode.PARAMS_ERROR);
//        }
//        final User loginUser = userService.getLoginUser(request);
//        long questionId = questionSubmitAddRequest.getQuestionId();
//        long questionSubmitId = QuestionSubmitService.doQuestionSubmit(questionSubmitAddRequest, loginUser);
//        return ResultUtils.success(questionSubmitId);
//    }
//
//    /**
//     * 分页获取列表（仅管理员可以查看所有信息，普通用户只能查看非答案提交代码等公开信息）
//     * @param questionSubmitQueryRequest
//     * @return
//     */
//    @PostMapping("/list/page")
//    public BaseResponse<Page<QuestionSubmitVO>> listPostByPage(@RequestBody QuestionSubmitQueryRequest questionSubmitQueryRequest,
//                                                               HttpServletRequest request) {
//        long current = questionSubmitQueryRequest.getCurrent();
//        long size = questionSubmitQueryRequest.getPageSize();
//        //先获取到所有的分页信息
//        Page<QuestionSubmit> questionSubmitPage = QuestionSubmitService.page(new Page<>(current, size),
//                QuestionSubmitService.getQueryWrapper(questionSubmitQueryRequest));
//        final User loginUser = userService.getLoginUser(request);
//        //返回脱敏信息
//        return ResultUtils.success(QuestionSubmitService.getQuestionSubmitVOPage(questionSubmitPage, loginUser));
//    }

}
